package com.dengyuanke.strategypattern;


import java.math.BigDecimal;

/**
 * Created by dengyuanke on 2017/8/24.
 */
public class Execute {

    public static void main(String[] args) {

        //金牌会员
        Price context=new Price(new GoldMember());
        BigDecimal goldPirce = context.getPirce(new BigDecimal(100));
        System.out.println("金牌会员最终价格:"+ goldPirce.setScale(2,BigDecimal.ROUND_HALF_UP));

        //银牌会员
        context=new Price(new SilverMember());
        BigDecimal silverPirce = context.getPirce(new BigDecimal(100));
        System.out.println("银牌会员最终价格:"+silverPirce.setScale(2,BigDecimal.ROUND_HALF_UP));

        //铜牌会员
        context=new Price(new BronzeMember());
        BigDecimal bronzePirce = context.getPirce(new BigDecimal(100));
        System.out.println("铜牌会员最终价格:"+bronzePirce.setScale(2,BigDecimal.ROUND_HALF_UP));

    }
}
